﻿<?php include("template/baglanti.php"); include ("template/upload.php"); include("template/header.php");



?>
  


<link rel="stylesheet" type="text/css" href="css/main.css" />
 
	<link rel="stylesheet" type="text/css" href="./media/css/jquery.dataTables.css">
	<link rel="stylesheet" type="text/css" href="./resources/syntax/shCore.css">
	<link rel="stylesheet" type="text/css" href="./resources/demo.css">
	<style type="text/css" class="init">

	</style>
	<script type="text/javascript" language="javascript" src="./media/js/jquery.js"></script>
	<script type="text/javascript" language="javascript" src="./media/js/jquery.dataTables.js"></script>
	<script type="text/javascript" language="javascript" src="./resources/syntax/shCore.js"></script>
	<script type="text/javascript" language="javascript" src="./resources/demo.js"></script>
	<script type="text/javascript" language="javascript" class="init">


$(document).ready(function() {
	$('#example').dataTable();
} );


	</script>



<body>



<div class="wrapper">

<div class="menu radius flt">
<?php include("./template/menu.php") ?>
 </div>

<div class="wrapperInside radius flt"> 

<div class="wrapperInsideCapture" style="margin-bottom:20px;">

	<?php
	
	$id = intval($_GET['id']);
$ctID = intval($_GET['ctID']);

		$cns = ("
SELECT ct.categori_name,  pd.Pdname,  ph.Phphoto  ,  ph.Phsphoto  , ph.Phname , ph.photoId
FROM products pd
INNER JOIN categori ct ON ct.categori_id = pd.categori_id
INNER JOIN photogaleri ph ON ph.categori_id = ct.categori_id
AND ph.PdId = pd.PdId
WHERE   pd.PdID = $id AND ct.categori_id = $ctID  order by ph.photoId  DESC
		");
		$cn = mysql_query($cns);
		$cnl = mysql_fetch_assoc($cn);
?>


<span style="color:#cc3333;" ><?=$cnl['categori_name']?></span> <span style="color:#99cc66;"> I </span> <?=$cnl['Pdname']?> 




</div>




<div class="galleryInside">

<?php 
$firstrow = mysql_fetch_assoc($cn);
mysql_data_seek($cn, 0);
while($photorow = mysql_fetch_assoc($cn)):
echo mysql_error();

?>

<div class="gInsideImg"> 
<div class="gInsideImgT">
			<?php if(!empty($photorow['Phsphoto'])):?>
			<img src="../upload/products/<?=$photorow['Phsphoto'];?>"  alt=""><?php else: ?> <img src="../upload/images/noneimg.jpg" > <?php endif; ?>
</div>

<div class="gInsideName"><?=$photorow['Phname'];?></div> 
<div class="clear"> </div>

<div class="gInsideEdit">
<div class="gInsideEditIcon" style="margin-left:0px;"> <a href="photoEdit.php?id=<?=$id?>&ctID=<?=$ctID?>&phid=<?= $photorow['photoId']?>" style="float:left; display:inline;">  <img src="images/edit.png"  width="30px" heigth="30px">  </a> </div>
<div class="gInsideEditIcon" >
<a href="photoDelete.php?id=<?=$id?>&ctID=<?=$ctID?>&phid=<?= $photorow['photoId']?>" onClick="return confirm('Are you sure delete thisp product?')" style="float:left; display:inline;"> <img src="images/Delete.png" width="30px" heigth="30px"> </a>  </div>
</div>
     
   </div>
   <?php endwhile; ?>
   
<div class="gInsideImg"> 

<div class="gInsideImgT" style=" margin-top:30px;"> <a href="productsGaleryAdd.php?id=<?=$id?>&ctID=<?=$ctID?>">  <img src="images/addbig.png" >   </a></div>

<div class="gInsideName" >Resim Ekle</div> 

 </div>   
   
</div>


</div>
</div>


<?php include("template/footer.php") ?>



